<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('AdminCountry/index')}">国家管理</a></li>
        <li><a href="{:url('AdminCountry/add')}">添加国家</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('AdminCountry/index')}">
        客户名称:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入名称">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('AdminCountry/index')}">清空</a>
    </form>

    <form method="post" class="js-ajax-form" action="{:url('AdminCountry/index')}">
        <div class="table-actions" style="display: none;">
            <button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminCountry/toggle',array('display'=>'1'))}" data-subcheck="true">
                {:lang('NORMAL')}
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminCountry/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('FORBIDDEN')}
            </button>
        </div>
        <empty name="keyword">
            <table class="table table-hover table-bordered table-list" id="menus-table">
                <thead>
                <tr>
                    <th width="16" style="padding-left:20px;">
                        <label>
                            <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                        </label>
                    </th>
                    <th width="50">ID</th>
                    <th>国家code</th>
                    <th>国家名称</th>
                    <th width="210">操作</th>
                </tr>
                </thead>
                <foreach name="countryData" item="vo">
                    <tr>
                        <td>
                            <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x"
                                   name="ids[]" value="{$vo.id}">
                        </td>
                        <td>{$vo.id}</td>
                        <td>{$vo.code}</td>
                        <td>{$vo.name}</td>
                        <td>
                            <a href="{:url('AdminCountry/delete',['id'=>$vo.id])}">删除</a>
                        </td>
                    </tr>
                </foreach>
                <tfoot>
                <tr>
                    <th width="16" style="padding-left:20px;">
                        <label>
                            <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                        </label>
                    </th>
                    <th width="50">ID</th>
                    <th>国家code</th>
                    <th>国家名称</th>
                    <th width="200">操作</th>
                </tr>
                </tfoot>
            </table>
            <else/>
            <table class="table table-hover table-bordered table-list">
                <thead>
                <tr>
                    <th width="16">
                        <label>
                            <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                        </label>
                    </th>
                    <th width="50">ID</th>
                    <th>国家code</th>
                    <th>国家名称</th>
                    <th width="200">操作</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="countryData" item="vo">
                    <tr>
                        <td>
                            <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x"
                                   name="ids[]" value="{$vo.id}">
                        </td>
                        <td>{$vo.id}</td>
                        <td>{$vo.code}</td>
                        <td>{$vo.name}</td>
                        <td>
                            <a href="{:url('AdminCountry/delete',['id'=>$vo.id])}">删除</a>
                        </td>
                    </tr>
                </foreach>
                </tbody>
                <tfoot>
                <tr>
                    <th width="16">
                        <label>
                            <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                        </label>
                    </th>
                    <th width="50">ID</th>
                    <th>国家code</th>
                    <th>国家名称</th>
                    <th width="200">操作</th>
                </tr>
                </tfoot>
            </table>
        </empty>
        <div class="table-actions" style="display: none;">
            <button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminCountry/toggle',array('display'=>'1'))}" data-subcheck="true">
                {:lang('DISPLAY')}
            </button>
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit"
                    data-action="{:url('AdminCountry/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('HIDE')}
            </button>
        </div>
        <ul class="pagination">{$page|default=''}</ul>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $(document).ready(function () {
        Wind.css('treeTable');
        Wind.use('treeTable', function () {
            $("#menus-table").treeTable({
                indent: 20,
                initialState: 'expanded'
            });
        });
    });
</script>
</body>
</html>